package cn.stronglink.assetmanage.business.inspection.model;


import android.util.Log;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


import cn.stronglink.assetmanage.MyApplication;
import cn.stronglink.assetmanage.R;
import cn.stronglink.assetmanage.dao.DaoManager;
import cn.stronglink.assetmanage.dao.PatrolDao;
import cn.stronglink.assetmanage.dao.PatrolDetailDao;
import cn.stronglink.assetmanage.entity.Patrol;
import cn.stronglink.assetmanage.entity.PatrolDetail;
import cn.stronglink.assetmanage.entity.Task;
import cn.stronglink.assetmanage.utils.Constants;


/**
 * Created by zhengjinglan on 2018/6/18.
 */

public class WaitPatrolModel {
    /**
     * 获取所有为巡检的数据，定1为未完成状态
     * @return
     */
    public List<Patrol> getDataByOrderNoDistince(){
        List<Patrol> patrolList = DaoManager.
                getDaoSession(MyApplication.APP_CONTEXT).getPatrolDao().queryBuilder().distinct()
                .orderDesc(PatrolDao.Properties.Id_).
                        where(PatrolDao.Properties.Status.eq(Constants.STATUS_ONE)).orderDesc(PatrolDao.Properties.BeginTime).list();
        DaoManager.getDaoSession(MyApplication.APP_CONTEXT).clear();
        if (patrolList != null){
            return patrolList;
        }
        Log.e("Model_patrolList:", patrolList.toString());
        return null;
    }


}
